<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" />
<title>코오롱</title>
<link rel="stylesheet" type="text/css" href="${requestScope.contextPath}/css/import.css" />
<script type="text/javascript" src="${requestScope.contextPath}/js/jquery-ui-1.8.14.custom/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="${requestScope.contextPath}/js/jquery-ui-1.8.14.custom/js/jquery-ui-1.8.14.custom.min.js"></script>
<script type="text/javascript" src="${requestScope.contextPath}/js/common.js"></script>
<c:set var="userAgent" value="${header['User-Agent']}" />
<fmt:setBundle basename="com.kolon.config.properties.config" var="config" />
<c:if test="${fn:indexOf(userAgent, 'Android') != -1}"><c:set var="platForm" value="Android" /></c:if>
<c:if test="${fn:indexOf(userAgent, 'iPhone') != -1}"><c:set var="platForm" value="iPhone" /></c:if>
<script type="text/javascript">
	function appBack() {
		document.location.href='${requestScope.contextPath}/business/mOI/mOIJudgeList.do?pageGubun=A&page=${param.page}&endY=${param.endY}';
	}
</script>
<script type="text/javascript">
	var cpyCD = '${sessionScope.SESSION_USER_INFO.CompanyCD}';
	var sugflag = '${param.sugflag}';
	function formCheck() {
		val = $('#JudCode').val();
		if (val == '' || val == undefined) {
			alert('심사을 선택해 주세요.');
			return;
		}
		if (cpyCD == 'KNC' && (val == 'A00011' || val == 'A00010')) {
			if (val == 'A00010' && '${map.StatusName}' == '') {
				alert('유형효과를 등록된 상태여야 심사확정이 가능합니다.');
				return;
			}
			if($('#JudOpinion').val() == '') {
				alert('심사의견을 입력해 주세요.');
				return;
			}
		} else if (cpyCD == 'KEC' && (val == 'A00105' || val == 'A00106')) {
			if ('${map.StatusName}' == '' && '${map.FileName}' == '') {
				alert('유형효과 및 증빙문서가 포함되어야 심사확정이 가능합니다.');
				return;
			}
		}
		if (confirm('확정하시겠습니까?')) {
			document.judgeForm.submit();
		}
	}
</script>
<script>
$(document).ready(function(){ 
	$('#viewPage_').find('img').each(function() {
		w = $(this).attr('width');
		h = $(this).attr('height');
		if (w > 230 || w == undefined) {
			imgUrl = "location.href='${requestScope.contextPath}/imgZoom.jsp?imgUrl=" + $(this).attr('src')+"&width="+$(this).attr('width')+"&height="+$(this).attr('height')+"'";
			$(this).attr('width', '230');
			$(this).attr('height', Math.round(h*(230/w)));
			$(this).attr('onClick', imgUrl);
		}
	});
});
</script>
</head>
<body>
	<div id="wrap">
		<div class="header">
			<h1>O.I. 제안</h1>
			<!--<p class="back"><a href="#"><img src="${requestScope.contextPath}/images/btn/btn_back.gif" alt="뒤로" /></a></p>-->
		</div><!-- // header -->
		<div class="content">
			<h3>실시제안</h3>
			<!--<p class="list"><a href="#"><img src="${requestScope.contextPath}/images/btn/btn_check.gif" alt="방문현황 조회등록" /></a></p>-->
			<div class="table5">
			<form name="judgeForm" action="${requestScope.contextPath}/business/mOI/mOIExecJudgeWrite.do" method="post" onsubmit="return false;">
			<input type="hidden" name="seq" value="${param.seq}" />
			<input type="hidden" name="page" value="${param.page}" />
			<input type="hidden" name="pageGubun" value="${param.pageGubun}" />
			<input type="hidden" name="endY" value="${param.endY}" />
			<input type="hidden" name="Class" value="${map.Class}" />
			<input type="hidden" name="ExecEmpID" value="${map.ExecEmpID}" />
			<input type="hidden" name="JoinerWeight" value="${map.strJoiner}" />
				<table summary="" cellspacing="0" style="width:100%;">
					<caption>실시제안 등록</caption>
					<colgroup>
						<col style="width:25%" />
						<col style="width:75%" />
						</colgroup>
					<tbody>
						<tr>
							<th scope="row"><label for="name">실시자</label></th>
							<td>
								<c:choose>
								<c:when test="${map.Unsigned eq 'Y'}">무기명</c:when>
								<c:otherwise>${map.ExecEmpName} ${map.ExecEmpDeptName} (${map.TelNum})</c:otherwise>
								</c:choose>
							</td>
						</tr>
						<tr>
							<th scope="row"><label for="date">제안일자</label></th>
							<td>${map.CreateDate}&nbsp;</td>
						</tr>
						<tr>
							<th scope="row"><label for="team">심사부서</label></th>
							<td>${map.JudgeDeptName}&nbsp;</td>
						</tr>
						<tr>
							<th scope="row"><label for="title">제목</label></th>
							<td>${map.Title}&nbsp;</td>
						</tr>
						<tr>
							<th scope="row">실시일자</th>
							<td>${map.ExecSDate} ~ ${map.ExecEDate}</td>
						</tr>
						<tr>
							<th scope="row">공동실시자</th>
							<td>${map.perStr}&nbsp;</td>
						</tr>
						<tr>
							<th scope="row"><label for="coment">내용</label></th>
							<td><div id="viewPage_">${map.Content}</div>&nbsp;</td>
						</tr>
						<tr>
							<th scope="row"><label for="coment1">유형효과</label></th>
							<td>
								<c:if test="${map.StatusName ne ''}">
								<table width="100%">
									<tr>
										<td width="60%">유형효과 : </td>
										<td width="40%" align="right">${map.StatusName}</td>
									</tr>
									<c:choose>
									<c:when test="${map.CompanyCD eq 'KEC' and map.Status eq 'A00053'}">
									<tr>
										<td>전체효과(매출) : </td>
										<td align="right">${map.YearEffect}원</td>
									</tr>
									<tr>
										<td>금년효과(매출) : </td>
										<td align="right">${map.ThisYearEffect}원</td>
									</tr>
									<tr>
										<td>전체효과(매출이익) : </td>
										<td align="right">${map.YearEffect2}원</td>
									</tr>
									<tr>
										<td>금년효과(매출이익) : </td>
										<td align="right">${map.YearEffect2}원</td>
									</tr>
									<tr>
										<td>산출근거 : </td>
										<td align="right">${map.Reson}</td>
									</tr>
									</c:when>
									<c:otherwise>
									<tr>
										<td><c:choose><c:when test="${map.CompanyCD eq 'KEC'}">전체</c:when><c:otherwise>년간</c:otherwise></c:choose>효과 : </td>
										<td align="right">${map.YearEffect}원</td>
									</tr>
									<tr>
										<td>금년효과 : </td>
										<td align="right">${map.ThisYearEffect}원</td>
									</tr>
									<tr>
										<td>산출근거 : </td>
										<td align="right">${map.Reson}</td>
									</tr>
									</c:otherwise>
									</c:choose>
								</table>
								<!-- <p><a href="#"><img src="${requestScope.contextPath}/images/btn/btn_modify.gif" alt="수정" /></a></p> -->
								</c:if>&nbsp;
							</td>
						</tr>
						<tr>
							<th scope="row"><label for="name1">심사자</label></th>
							<td>${map.JudgeEmpName}&nbsp;</td>
							
						</tr>
						<tr>
							<th scope="row">심 사</th>
							<td>
								<select id="JudCode" name="JudCode" style="width:50%;">
									<option value="">심사 선택</option>
								<c:forEach var="gbMap" items="${gbList}" varStatus="state">
									<option value="${gbMap.UCODE}">${gbMap.SUB1}</option>
								</c:forEach>
								</select>
							</td>
						</tr>
						<tr>
							<th scope="row">검색공개</th>
							<td>
								<select name="SearchAuth" style="width:50%;">
									<option value="1">그룹공개</option>
									<option value="2">소속사공개</option>
									<option value="3">보안</option>
								</select>
							</td>
						</tr>
						<tr>
							<th scope="row"><label for="JudOpinion">심사의견</label></th>
							<td><textarea cols="30" name="JudOpinion" rows="3" id="JudOpinion" class="comment"></textarea></td>
						</tr>
					</tbody>
				</table>
				</form>
			</div>
			<div class="btn_area2" style="padding-bottom:20px;">
				<p>
					<a href="javascript:formCheck();"><img src="${requestScope.contextPath}/images/oi/btn_confirm.gif" alt="심사확정" /></a>&nbsp;&nbsp;
					<a href="${requestScope.contextPath}/business/mOI/mOIJudgeList.do?pageGubun=${param.pageGubun}&page=${param.page}&endY=${param.endY}"><img src="${requestScope.contextPath}/images/btn/btn_view2.gif" alt="목록보기" /></a>
				</p>
			</div>
		</div><!-- // content -->
	</div><!-- // wrap -->
</body>
</html>